PLAY Statements (Event Trapping) ---------------------------------------------------------------------------- Action Enable, disable, and suspend play-event trapping. Syntax PLAY ON PLAY OFF PLAY STOP Remarks The PLAY ON statement enables play-event trapping. (A play event occurs when the number of notes in the background music queue drops below the limit you set with the ON PLAY statement.) If a play event occurs after a PLAY ON statement, the routine specified in the ON PLAY statement is executed. The PLAY OFF statement disables play-event trapping. No trapping takes place until a PLAY ON statement is executed. Events occurring while trapping is off are ignored. PLAY STOP suspends play-event trapping. No trapping takes place until a PLAY ON statement is executed. Events occurring while trapping is suspended are remembered and processed when the next PLAY ON statement is executed. However, remembered events are lost if PLAY OFF is executed. When a play-event trap occurs (that is, the GOSUB is performed), an automatic PLAY STOP is executed so that recursive traps cannot take place. The RETURN operation from the trapping routine automatically executes a PLAY ON statement unless an explicit PLAY OFF was performed inside the routine. For more information, see Chapter 9, "Event Handling" in the Programmer's Guide. Note The PLAY statements (event trapping) are not available for OS-2 protected mode. See Also ON event, PLAY Function, PLAY Statements (Music) Example See the PLAY function programming example, which uses the PLAY ON statement.